home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / ClassEditor.0.4 / Source / RZBrowserCell.subproj / RZTextToken.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-04  |  1.6 KB  |  55 lines

  1. /* 
  2.  * RZTextToken - support object for the RZBrowserCell that represents
  3.  *     a piece of text with a particular font and color
  4.  *
  5.  * You may freely copy, distribute and reuse the code in this example.
  6.  * This code is provided AS IS without warranty of any kind, expressed 
  7.  * or implied, as to its fitness for any particular use.
  8.  *
  9.  * Copyright 1995 Ralph Zazula (rzazula@next.com).  All Rights Reserved.
  10.  *
  11.  */
  12.  
  13. #import <objc/Object.h>
  14.  
  15. @interface RZTextToken : Object
  16. {
  17.     unsigned index;                // which tab stop
  18.     id data;                            // RZSimpleString or an NXImage
  19.     struct _rzTextTokenFlags {
  20. #ifdef __BIG_ENDIAN__
  21.         unsigned int text:1;        // text: 0 - text, 1 - image name or image file name
  22.         unsigned int font:2;        // font: 0 - normal, 1 - bold, 2 - italic, 3 - italic/bold
  23.         unsigned int color:2;    // color:0 - black, 1 - dkgray, 2 - ltgray, 3 - white
  24.         unsigned int _RESERVED:17;
  25. #else
  26.         unsigned int _RESERVED:17;
  27.         unsigned int color:2;    // color:0 - black, 1 - dkgray, 2 - ltgray, 3 - white
  28.         unsigned int font:2;        // font: 0 - normal, 1 - bold, 2 - italic, 3 - italic/bold
  29.         unsigned int text:1;        // text: 0 - text, 1 - image name or image file name
  30. #endif
  31.     } _flags;
  32. }
  33.  
  34. - init;
  35. - initText:(const char *)format at:(unsigned)i,...;
  36. - initText:(const char *)format at:(unsigned)i font:(char)font color:(char)color,...;
  37. - initImage:(const char *)d at:(unsigned)i;
  38. - initData:(const char *)d at:(unsigned)i isText:(BOOL)isText 
  39.     font:(char)font color:(char)color;
  40.  
  41. - (unsigned)position;
  42. - data;
  43. - (BOOL)isText;
  44. - (char)font;
  45. - (char)color;
  46.  
  47. - write:(NXTypedStream *)ts;
  48. - read:(NXTypedStream *)ts;
  49.  
  50. @end
  51.  
  52. @interface RZTextToken(RZSortableObjects)
  53. - (unsigned)sortIndex;
  54. @end
  55.